package com.hmall.feign;


import com.hmall.common.dto.Address;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.pojo.Item;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@org.springframework.cloud.openfeign.FeignClient("itemservice")
public interface FeignClient {

    @GetMapping("/item/list")
    PageDTO<Item> list(@RequestParam Integer page, @RequestParam Integer size);

    @GetMapping("/item/{id}")
    Item selectItemById(@PathVariable("id") Long id);

    @PutMapping("/item/stock/{itemId}/{num}")
    void updateStock(@RequestParam Long itemId ,@RequestParam Integer num);

    @PutMapping("/item/add/{itemId}/{num}")
    void reliveStock(@RequestParam Long itemId ,@RequestParam Integer num);

}
